feat: add inline hooks quota support#9078
Merged
wangsijie merged 9 commits intoJun 25, 2026
Merged
Conversation
COMPARE TO
|
| Name | Diff |
|---|---|
| packages/console/package.json | 0 Bytes |
| packages/console/src/cloud/types/router.ts | 📈 +290 Bytes |
| packages/console/src/consts/plan-quotas.ts | 📈 +126 Bytes |
| packages/console/src/consts/quota-item-phrases.ts | 📈 +222 Bytes |
| packages/console/src/consts/tenants.ts | 📈 +146 Bytes |
| packages/console/src/contexts/SubscriptionDataProvider/use-subscription-data.ts | 📈 +674 Bytes |
| packages/console/src/pages/TenantSettings/Subscription/DowngradeConfirmModalContent/PlanQuotaDiffCard/PlanQuotaList/DiffQuotaItem/SkuQuotaItemPhrase.tsx | 📈 +96 Bytes |
| packages/console/src/pages/TenantSettings/components/NotEligibleSwitchPlanModalContent/index.tsx | 📈 +101 Bytes |
| packages/console/src/types/skus.ts | 📈 +5 Bytes |
| packages/core/package.json | 0 Bytes |
| packages/core/src/mocks/cloud-connection.ts | 📈 +29 Bytes |
| packages/core/src/queries/tenant-usage/types.ts | 📈 +48 Bytes |
| packages/core/src/utils/subscription/index.ts | 📈 +242 Bytes |
| packages/core/src/utils/subscription/types.ts | 📈 +110 Bytes |
| pnpm-lock.yaml | 📈 +217 Bytes |
6881986 to
0ea9051
Compare
045b209 to
00e09a2
Compare
charIeszhao
approved these changes
Jun 25, 2026
charIeszhao
left a comment
Member
There was a problem hiding this comment.
Reviewed the quota plumbing. No standalone blockers from my side; runtime enforcement is tracked in the runner PR.
Base automatically changed from
wangsijie-log-13689-define-logtoinlinehookkey-enum-and-zod-config-guards
to
master
June 25, 2026 06:34
…add-inlinehooksenabled-subscription-quota-flag # Conflicts: # packages/schemas/src/types/logto-config/inline-hook.ts
Contributor
There was a problem hiding this comment.
Pull request overview
Completes Logto Core + Console support for the Cloud subscription quota key inlineHooksEnabled, ensuring older Cloud payloads (missing the key) are treated as disabled by default and keeping the capability hidden from plan quota UI for now.
Changes:
- Extend Core/Console subscription quota + usage types to include
inlineHooksEnabled. - Normalize Core/Console subscription data to default
inlineHooksEnabledtofalsewhen absent. - Hide
inlineHooksEnabledfrom quota UI phrasing/diff rendering while still being represented in types and defaults.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updates lockfile entries for the bumped Cloud package version. |
| packages/core/src/utils/subscription/types.ts | Adds inlineHooksEnabled to Core subscription quota/usage types and zod guards. |
| packages/core/src/utils/subscription/index.ts | Normalizes fetched subscription quota to default inlineHooksEnabled: false. |
| packages/core/src/queries/tenant-usage/types.ts | Adds inlineHooksEnabled to Core quota usage key enums (boolean quota path). |
| packages/core/src/mocks/cloud-connection.ts | Extends mocked quota to include inlineHooksEnabled. |
| packages/core/package.json | Bumps @logto/cloud dependency revision. |
| packages/console/src/types/skus.ts | Adjusts comment formatting for SKU type definitions. |
| packages/console/src/pages/TenantSettings/Subscription/DowngradeConfirmModalContent/PlanQuotaDiffCard/PlanQuotaList/DiffQuotaItem/SkuQuotaItemPhrase.tsx | Guards phrase rendering to skip hidden/non-phrase quota keys (incl. inline hooks). |
| packages/console/src/pages/TenantSettings/components/NotEligibleSwitchPlanModalContent/index.tsx | Excludes inlineHooksEnabled from “not eligible” quota rendering and adds phrase-key guarding. |
| packages/console/src/contexts/SubscriptionDataProvider/use-subscription-data.ts | Normalizes subscription quota/usage objects by merging defaults (covers missing inlineHooksEnabled). |
| packages/console/src/consts/tenants.ts | Adds inlineHooksEnabled (and required quota fields) to default SKU/quota/usage constants. |
| packages/console/src/consts/quota-item-phrases.ts | Excludes inlineHooksEnabled from quota phrase maps and adds a type guard helper. |
| packages/console/src/consts/plan-quotas.ts | Hides inlineHooksEnabled in plan quota UI diff list with an explanatory comment. |
| packages/console/src/cloud/types/router.ts | Extends subscription quota/usage types with inlineHooksEnabled and relaxes SKU quota typing for backward compatibility. |
| packages/console/package.json | Bumps @logto/cloud dependency revision. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
charIeszhao
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes Logto-side support for the
inlineHooksEnabledsubscription quota key.This PR keeps
inlineHooksEnabledon the boolean feature-quota path: Core and Console treat older Cloud responses asfalsewhen the key is absent, Console includes the key in subscription usage/quota types, and the default Console development SKU keeps inline hooks disabled. The rollout plan is still selected-enterprise-only: only selected enterprise SKUs should be manually enabled, and everyone else stays disabled.The SKU quota item is intentionally hidden from the Console plan quota UI for now, with an inline comment noting that it should wait until further testing before being opened.
It is intentionally not added to add-on/reportable usage reporting.
Cloud companion PR: logto-io/cloud#1956.
Testing
Tested locally
Note
Medium Risk
Touches subscription typing and quota normalization used for entitlements; behavior stays opt-in (default false) but incorrect defaults could affect feature gating when Cloud enables the flag.
Overview
Adds
inlineHooksEnabledas a boolean subscription quota across Console and Core, aligned with an updated@logto/cloudpackage.Core extends subscription quota/usage types and tenant-usage guards, defaults missing Cloud values to
falseingetTenantSubscription, and includes the flag in the Redis subscription cache schema. It is not added to reportableitem-updatesusage keys.Console merges API quota/usage with defaults via
normalizeSubscriptionQuota/normalizeSubscriptionUsage, setsinlineHooksEnabled: falseon default SKUs, and keeps the quota out of plan UI (hidden downgrade diff, excluded phrase maps, filtered in upgrade/downgrade modals) until further testing.Also bumps default dev SKU fields for
samlApplicationsLimitandcustomDomainsLimitin tenant constants.Reviewed by Cursor Bugbot for commit 6e5e585. Bugbot is set up for automated code reviews on this repo. Configure here.